load("@rules_rust//rust:defs.bzl", "rust_library")
load("//bazel:canisters.bzl", "rust_canister")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    # Keep sorted.
    "//packages/ic-http-types",
    "@crate_index//:candid",
    "@crate_index//:ciborium",
    "@crate_index//:futures",
    "@crate_index//:ic-cdk",
    "@crate_index//:ic-cdk-timers",
    "@crate_index//:ic-metrics-encoder",
    "@crate_index//:ic-stable-structures",
    "@crate_index//:ic-xrc-types",
    "@crate_index//:ic0",
    "@crate_index//:num-traits",
    "@crate_index//:serde",
    "@crate_index//:serde_bytes",
]

MACRO_DEPENDENCIES = [
    # Keep sorted.
    "@crate_index//:async-trait",
]

rust_library(
    name = "xrc_mock",
    srcs = glob(["src/**/*.rs"]),
    crate_name = "xrc_mock",
    proc_macro_deps = MACRO_DEPENDENCIES,
    deps = DEPENDENCIES,
)

rust_canister(
    name = "xrc_mock_canister",
    srcs = ["src/main.rs"],
    crate_name = "xrc_mock_canister",
    proc_macro_deps = MACRO_DEPENDENCIES,
    service_file = "xrc.did",
    deps = [":xrc_mock"] + DEPENDENCIES,
)
